package com.powerteam.mapper.crm;

import com.powerteam.model.crm.Customer;
import com.powerteam.model.crm.CustomerCategory;
import com.powerteam.model.crm.Industry;
import com.powerteam.model.crm.Source;
import com.powerteam.vo.crm.QueryCustomerVO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 客户表相关的操作
 *
 * @author jinming.zhang
 * @version 0.0.1
 * @date 2021/12/30
 */
@Mapper
public interface CustomerMapper {

    /**
     * 分页查询客户信息
     *
     * @param vo
     * @return List<Customer>
     * @Author jinming.zhang
     * @Date 2022/1/10
     */
    List<Customer> find(QueryCustomerVO vo);

    /**
     * 查找所有客户类别
     *
     * @param
     * @return List<CustomerCategory>
     * @Author jinming.zhang
     * @Date 2022/1/10
     */
    List<CustomerCategory> findAllCustomerCategory();

    /**
     * 查找所有行业
     *
     * @param
     * @return List<Industry>
     * @Author jinming.zhang
     * @Date 2022/1/10
     */
    List<Industry> findAllIndustry();

    /**
     * 查找所有来源
     *
     * @param
     * @return List<Source>
     * @Author jinming.zhang
     * @Date 2022/1/10
     */
    List<Source> findAllSource();

    /**
     * 添加客户信息
     *
     * @param customer
     * @return int
     * @Author jinming.zhang
     * @Date 2022/1/10
     */
    int insert(Customer customer);

    /**
     * 查询客户是否存在
     *
     * @param customer
     * @return Boolean
     * @Author jinming.zhang
     * @Date 2022/1/10
     */
    Boolean existCustomerName(Customer customer);

    /**
     * 根据Id查询客户信息
     *
     * @param customerId
     * @return Customer
     * @Author jinming.zhang
     * @Date 2022/1/10
     */
    Customer findById(Integer customerId);

    /**
     * 修改客户信息
     *
     * @param customer
     * @return int
     * @Author jinming.zhang
     * @Date 2022/1/10
     */
    int update(Customer customer);

    /**
     * 删除客户信息
     *
     * @param customerId
     * @return int
     * @Author jinming.zhang
     * @Date 2022/4/13
     */
    int remove(Integer customerId);
}
